home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c.moderated,comp.std.c
- Subject: Re: 'h' modifier in printf
- Date: 25 Mar 1996 06:22:50 -0600
- Organization: CERN European Lab for Particle Physics
- Sender: clc@solutions.solon.com
- Approved: clc@solutions.solon.com
- Message-ID: <4j636q$3hm@solutions.solon.com>
- References: <4i801c$455@solutions.solon.com> <4j06rd$82n@solutions.solon.com>
- NNTP-Posting-Host: solutions.solon.com
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4j06rd$82n@solutions.solon.com> holdp@essex.ac.uk (Holden P) writes:
-
- >printf("Vanilla %X\nWith h %hX\n", -1, -1);
- >
- >says
- >
- >Vanilla FFFFFFFF
- >With h FFFF
-
- Since the type of -1 is not unsigned int and it appears in a context where
- the compiler is not required to perform the conversion, this example
- invokes undefined behaviour, hence it cannot be used to demonstrate
- anything.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-